using System;
using System.Collections.Generic;
using System.Globalization;

namespace ApkInstaller.Util
{
	public class ApkInfo
	{
		public static int FINE = 0;

		public static int NULL_VERSION_CODE = 1;

		public static int NULL_VERSION_NAME = 2;

		public static int NULL_PERMISSION = 3;

		public static int NULL_ICON = 4;

		public static int NULL_CERT_FILE = 5;

		public static int BAD_CERT = 6;

		public static int NULL_SF_FILE = 7;

		public static int BAD_SF = 8;

		public static int NULL_MANIFEST = 9;

		public static int NULL_RESOURCES = 10;

		public static int NULL_DEX = 13;

		public static int NULL_METAINFO = 14;

		public static int BAD_JAR = 11;

		public static int BAD_READ_INFO = 12;

		public static int NULL_FILE = 15;

		public static int HAS_REF = 16;

		public string label;

	    public string activeActivity;

		public string versionName;

		public string versionCode;

		public string minSdkVersion;

		public string targetSdkVersion;

		public string packageName;

		public List<string> Permissions;

		public List<string> iconFileName;

		public List<string> iconFileNameToGet;

		public List<string> iconHash;

		public string resourcesFileName;

		public byte[] resourcesFileBytes;

		public bool hasIcon;

		public bool supportSmallScreens;

		public bool supportNormalScreens;

		public bool supportLargeScreens;

		public bool supportAnyDensity;

		public Dictionary<string, List<string>> resStrings;

		public Dictionary<string, string> layoutStrings;

		public static bool supportSmallScreen(byte[] dpi)
		{
			return dpi[0] == 1;
		}

		public static bool supportNormalScreen(byte[] dpi)
		{
			return dpi[1] == 1;
		}

		public static bool supportLargeScreen(byte[] dpi)
		{
			return dpi[2] == 1;
		}

		public ApkInfo()
		{
			this.hasIcon = false;
			this.supportSmallScreens = false;
			this.supportNormalScreens = false;
			this.supportLargeScreens = false;
			this.supportAnyDensity = true;
			this.versionCode = null;
			this.versionName = null;
			this.iconFileName = null;
			this.iconFileNameToGet = null;
			this.Permissions = new List<string>();
		}

		private bool isReference(List<string> strs)
		{
			bool result;
			try
			{
				foreach (string current in strs)
				{
					bool flag = this.isReference(current);
					if (flag)
					{
						result = true;
						return result;
					}
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
			result = false;
			return result;
		}

		private bool isReference(string str)
		{
			bool result;
			try
			{
				bool flag = str != null && str.StartsWith("@");
				if (flag)
				{
					int.Parse(str, NumberStyles.HexNumber);
					result = true;
					return result;
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
			result = false;
			return result;
		}
	}
}
